<!--
 * @Descripttion: HN-SaaS管理系统
 * @version: 1.0.0
 * @Author: 侯建军
 * @Date: 2020-09-11 11:19:34
 * @LastEditors: 侯建军
 * @LastEditTime: 2020-09-12 11:29:57
-->
<template>
  <div>
    <el-tree :data="menuData" :props="props"  show-checkbox @node-click="handleNodeClick"></el-tree>
  </div>
</template>

<script>
import { getMenuAll } from "@/api/resource.js";

export default {
  name: "",
  data() {
    return {
      props: {
        label: "title",
        children: "children",
      },
      menuData: [],
    };
  },
  created() {
    this.loadMenuData();
  },
  methods: {
    loadMenuData() {
      getMenuAll().then((res) => {
        this.menuData = res.data.data;
      });
    },
    handleNodeClick(data) {
      console.log(data);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>